--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  E:\Seagate Sync\VOL\Personal folder\Documents\Research\Past project
> s\cbld\Posted\121020 Website\Data analysis\cbld-management02.log
  log type:  text
 opened on:  21 Oct 2012, 15:41:07

. 
. 
. * **********************************
. * Consensus rates expected by chance
. * **********************************
. 
. * Programme:    cbld-management02.do
. * Project:              Council coalition building
. * Author:               Frank Haege, Department of Politics and Administration
> , University of Limerick
. * Contact:              frank.haege@ul.ie
. 
. * Description
. *************
. * This do-file generates data about consensus rates expected by chance for dif
> ferent 
. * membership sizes (i.e. consensual and non-consensual decisions are equally l
> ikely)
. 
. 
. * Set up Stata
. version 11

. clear all

. macro drop _all

. set linesize 80

. set more off

. 
. * Set number of observations
. set obs 3
obs was 0, now 3

. 
. * Generate membership size variable
. generate nostates = .
(3 missing values generated)

. replace nostates = 12 if _n == 1
(1 real change made)

. replace nostates = 15 if _n == 2
(1 real change made)

. replace nostates = 25 if _n == 3
(1 real change made)

. label var nostates "Number of member states"

. tab nostates, m

  Number of |
     member |
     states |      Freq.     Percent        Cum.
------------+-----------------------------------
         12 |          1       33.33       33.33
         15 |          1       33.33       66.67
         25 |          1       33.33      100.00
------------+-----------------------------------
      Total |          3      100.00

. 
. * Generate consensus rate expected by chance
. generate econsensus = 0.5

. label var econsensus "Expected consensus (chance)"

. 
. * Generate standard error of expected consensus rate
. generate ese = sqrt((econsensus * (1 - econsensus)) / 1000)

. label var ese "Standard error (null)"

. 
. * Generate lower and upper bound of confidence interval of consensus rate
. generate elowerci = (econsensus - (1.96 * ese))

. label var elowerci "CI lower bound (null)"

. generate eupperci = (econsensus + (1.96 * ese))

. label var eupperci "CI upper bound (null)"

. 
. * Save data set
. sort nostates

. save "Experiments\Other data\cbld-management02.dta", replace
file Experiments\Other data\cbld-management02.dta saved

. 
. 
. * Exit do-file
. log close
      name:  <unnamed>
       log:  E:\Seagate Sync\VOL\Personal folder\Documents\Research\Past project
> s\cbld\Posted\121020 Website\Data analysis\cbld-management02.log
  log type:  text
 closed on:  21 Oct 2012, 15:41:07
--------------------------------------------------------------------------------
